JP 2004-257331 A discloses a technique for facilitating activation of a catalyst under such conditions that the catalyst becomes inactive. In this technique, the catalyst activation operation by which the operation of the variable valve timing mechanism is changed to increase the exhaust gas amount remaining in the combustion chamber after the exhaust period of the combustion chamber is performed. According to such an operation, the air-fuel ratio in the combustion chamber is set to the richer side to increase carbon monoxide gas in the exhaust gas, and accordingly, the catalyst temperature is increased. As a result, the activation of the catalyst is facilitated even under a condition that the catalyst becomes inactive.